#!/usr/local/bin/python3
# -*- coding: UTF-8 -*-
"""
@author:apple
@file:demo03.py
@time:2021/07/23
"""

def test01():
    ...
    names = ['zhangsan','lisi','wangwu']

    *pre,name = names
    print(name)
    print(pre)

    user_msg = 'nobody:*:-2:-2:Unprivileged User:/var/empty:/usr/bin/false'
    user_name,*_ = user_msg.split(':')
    print(user_name)


def test02():
    ...
    records = [('zhangsan',21,'男'),('莉丝',22,'女')]

    name,*_ = next(iter(records))
    print(name)
    for name,*_ in records:
        """
        """
        print(name)


def test03(flag):
    ...
    return flag+1 if flag > 5 else 0


def test04():
    ...
    from collections import deque

    deq = deque(maxlen=3)
    for i in range(10):
        deq.append(i)

    print(deq)
    deq.appendleft(4)
    deq.appendleft(5)
    print(deq)

def test05():
    ...
    import heapq

    print(heapq.nlargest(2, [1, 3, 4, 2, 5, 8]))
    # heapq = []
    # print(heapq)
    with open('./demo03.py',mode='tr') as f:
        ...
        for l in f:
            print(l)


def test06():
    ...
    # import getpass
    # user = getpass.getuser()
    # passw = getpass.getpass()
    # print(user,passw)
    import webbrowser
    webbrowser.open('https://www.baidu.com')

if __name__ == '__main__':
    pass
    # print(test03(3))
    # test05()
    build = """/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -target arm64-apple-ios10.0 -fmessage-length\=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -std\=gnu11 -fobjc-arc -fobjc-weak -fmodules -gmodules -fmodules-cache-path\=/Users/apple/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -fmodules-prune-interval\=86400 -fmodules-prune-after\=345600 -fbuild-session-file\=/Users/apple/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror\=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror\=return-type -Wdocumentation -Wunreachable-code -Wquoted-include-in-framework-header -Wno-implicit-atomic-properties -Werror\=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror\=objc-root-class -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -DDEBUG\=1 -DOBJC_OLD_DISPATCH_PROTOTYPES\=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -g -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wno-semicolon-before-method-body -Wunguarded-availability -fembed-bitcode-marker -index-store-path /Users/apple/Library/Developer/Xcode/DerivedData/ffmpeg_demo01-cibjdfqfvocakbawlpstqflsymoi/Index/DataStore -iquote /Users/apple/Library/Developer/Xcode/DerivedData/ffmpeg_demo01-cibjdfqfvocakbawlpstqflsymoi/Build/Intermediates.noindex/ffmpeg_demo01.build/Debug-iphoneos/ffmpeg_demo01.build/ffmpeg_demo01-generated-files.hmap -I/Users/apple/Library/Developer/Xcode/DerivedData/ffmpeg_demo01-cibjdfqfvocakbawlpstqflsymoi/Build/Intermediates.noindex/ffmpeg_demo01.build/Debug-iphoneos/ffmpeg_demo01.build/ffmpeg_demo01-own-target-headers.hmap -I/Users/apple/Library/Developer/Xcode/DerivedData/ffmpeg_demo01-cibjdfqfvocakbawlpstqflsymoi/Build/Intermediates.noindex/ffmpeg_demo01.build/Debug-iphoneos/ffmpeg_demo01.build/ffmpeg_demo01-all-target-headers.hmap -iquote /Users/apple/Library/Developer/Xcode/DerivedData/ffmpeg_demo01-cibjdfqfvocakbawlpstqflsymoi/Build/Intermediates.noindex/ffmpeg_demo01.build/Debug-iphoneos/ffmpeg_demo01.build/ffmpeg_demo01-project-headers.hmap -I/Users/apple/Library/Developer/Xcode/DerivedData/ffmpeg_demo01-cibjdfqfvocakbawlpstqflsymoi/Build/Products/Debug-iphoneos/include -I/Users/apple/Documents/ffmpeg/ffmpeg_demo01/ffmpeg_demo01/ffmpeg/include -I/Users/apple/Library/Developer/Xcode/DerivedData/ffmpeg_demo01-cibjdfqfvocakbawlpstqflsymoi/Build/Intermediates.noindex/ffmpeg_demo01.build/Debug-iphoneos/ffmpeg_demo01.build/DerivedSources-normal/arm64 -I/Users/apple/Library/Developer/Xcode/DerivedData/ffmpeg_demo01-cibjdfqfvocakbawlpstqflsymoi/Build/Intermediates.noindex/ffmpeg_demo01.build/Debug-iphoneos/ffmpeg_demo01.build/DerivedSources/arm64 -I/Users/apple/Library/Developer/Xcode/DerivedData/ffmpeg_demo01-cibjdfqfvocakbawlpstqflsymoi/Build/Intermediates.noindex/ffmpeg_demo01.build/Debug-iphoneos/ffmpeg_demo01.build/DerivedSources -F/Users/apple/Library/Developer/Xcode/DerivedData/ffmpeg_demo01-cibjdfqfvocakbawlpstqflsymoi/Build/Products/Debug-iphoneos -MMD -MT dependencies -MF /Users/apple/Library/Developer/Xcode/DerivedData/ffmpeg_demo01-cibjdfqfvocakbawlpstqflsymoi/Build/Intermediates.noindex/ffmpeg_demo01.build/Debug-iphoneos/ffmpeg_demo01.build/Objects-normal/arm64/WAVSoundRecord.d --serialize-diagnostics /Users/apple/Library/Developer/Xcode/DerivedData/ffmpeg_demo01-cibjdfqfvocakbawlpstqflsymoi/Build/Intermediates.noindex/ffmpeg_demo01.build/Debug-iphoneos/ffmpeg_demo01.build/Objects-normal/arm64/WAVSoundRecord.dia -c /Users/apple/Documents/ffmpeg/ffmpeg_demo01/ffmpeg_demo01/WAVSoundRecord.m -o /Users/apple/Library/Developer/Xcode/DerivedData/ffmpeg_demo01-cibjdfqfvocakbawlpstqflsymoi/Build/Intermediates.noindex/ffmpeg_demo01.build/Debug-iphoneos/ffmpeg_demo01.build/Objects-normal/arm64/WAVSoundRecord.o"""
    for b in build.split(' '):
        print(b)
